/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.AdGroupSuggestedKeywordsResponse;
import org.openapitools.client.model.AdGroupSuggestedKeywordsResponseEx;
import java.math.BigDecimal;
import org.openapitools.client.model.Error;
import org.openapitools.client.model.GetAsinSuggestedKeywordsResponse;
import org.openapitools.client.model.InlineObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SuggestedKeywordsApi {
    private ApiClient localVarApiClient;

    public SuggestedKeywordsApi() {
        this(Configuration.getDefaultApiClient());
    }

    public SuggestedKeywordsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for bulkGetAsinSuggestedKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param inlineObject  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call bulkGetAsinSuggestedKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, InlineObject inlineObject, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = inlineObject;

        // create path and map variables
        String localVarPath = "/v2/sp/asins/suggested/keywords";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call bulkGetAsinSuggestedKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, InlineObject inlineObject, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling bulkGetAsinSuggestedKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling bulkGetAsinSuggestedKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = bulkGetAsinSuggestedKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, inlineObject, _callback);
        return localVarCall;

    }

    /**
     * Gets suggested keyword for a specified list of ASINs.
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param inlineObject  (optional)
     * @return List&lt;Object&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public List<Object> bulkGetAsinSuggestedKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, InlineObject inlineObject) throws ApiException {
        ApiResponse<List<Object>> localVarResp = bulkGetAsinSuggestedKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, inlineObject);
        return localVarResp.getData();
    }

    /**
     * Gets suggested keyword for a specified list of ASINs.
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param inlineObject  (optional)
     * @return ApiResponse&lt;List&lt;Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<Object>> bulkGetAsinSuggestedKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, InlineObject inlineObject) throws ApiException {
        okhttp3.Call localVarCall = bulkGetAsinSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, inlineObject, null);
        Type localVarReturnType = new TypeToken<List<Object>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets suggested keyword for a specified list of ASINs. (asynchronously)
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param inlineObject  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call bulkGetAsinSuggestedKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, InlineObject inlineObject, final ApiCallback<List<Object>> _callback) throws ApiException {

        okhttp3.Call localVarCall = bulkGetAsinSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, inlineObject, _callback);
        Type localVarReturnType = new TypeToken<List<Object>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAdGroupSuggestedKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupSuggestedKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String adStateFilter, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/adGroups/{adGroupId}/suggested/keywords"
            .replaceAll("\\{" + "adGroupId" + "\\}", localVarApiClient.escapeString(adGroupId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (maxNumSuggestions != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxNumSuggestions", maxNumSuggestions));
        }

        if (adStateFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("adStateFilter", adStateFilter));
        }

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAdGroupSuggestedKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String adStateFilter, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getAdGroupSuggestedKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getAdGroupSuggestedKeywords(Async)");
        }
        
        // verify the required parameter 'adGroupId' is set
        if (adGroupId == null) {
            throw new ApiException("Missing the required parameter 'adGroupId' when calling getAdGroupSuggestedKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, adStateFilter, _callback);
        return localVarCall;

    }

    /**
     * Gets suggested keywords for the specified ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @return AdGroupSuggestedKeywordsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public AdGroupSuggestedKeywordsResponse getAdGroupSuggestedKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String adStateFilter) throws ApiException {
        ApiResponse<AdGroupSuggestedKeywordsResponse> localVarResp = getAdGroupSuggestedKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, adStateFilter);
        return localVarResp.getData();
    }

    /**
     * Gets suggested keywords for the specified ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @return ApiResponse&lt;AdGroupSuggestedKeywordsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<AdGroupSuggestedKeywordsResponse> getAdGroupSuggestedKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String adStateFilter) throws ApiException {
        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, adStateFilter, null);
        Type localVarReturnType = new TypeToken<AdGroupSuggestedKeywordsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets suggested keywords for the specified ad group. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupSuggestedKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String adStateFilter, final ApiCallback<AdGroupSuggestedKeywordsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, adStateFilter, _callback);
        Type localVarReturnType = new TypeToken<AdGroupSuggestedKeywordsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAdGroupSuggestedKeywordsEx
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param suggestBids Set to &#x60;yes&#x60; to include a suggest bid for the suggested keyword in the response. Otherwise, set to &#x60;no&#x60;. (optional, default to no)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupSuggestedKeywordsExCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String suggestBids, String adStateFilter, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/adGroups/{adGroupId}/suggested/keywords/extended"
            .replaceAll("\\{" + "adGroupId" + "\\}", localVarApiClient.escapeString(adGroupId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (maxNumSuggestions != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxNumSuggestions", maxNumSuggestions));
        }

        if (suggestBids != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("suggestBids", suggestBids));
        }

        if (adStateFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("adStateFilter", adStateFilter));
        }

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAdGroupSuggestedKeywordsExValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String suggestBids, String adStateFilter, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getAdGroupSuggestedKeywordsEx(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getAdGroupSuggestedKeywordsEx(Async)");
        }
        
        // verify the required parameter 'adGroupId' is set
        if (adGroupId == null) {
            throw new ApiException("Missing the required parameter 'adGroupId' when calling getAdGroupSuggestedKeywordsEx(Async)");
        }
        

        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsExCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, suggestBids, adStateFilter, _callback);
        return localVarCall;

    }

    /**
     * Gets suggested keywords with extended data for the specified ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param suggestBids Set to &#x60;yes&#x60; to include a suggest bid for the suggested keyword in the response. Otherwise, set to &#x60;no&#x60;. (optional, default to no)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @return List&lt;AdGroupSuggestedKeywordsResponseEx&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public List<AdGroupSuggestedKeywordsResponseEx> getAdGroupSuggestedKeywordsEx(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String suggestBids, String adStateFilter) throws ApiException {
        ApiResponse<List<AdGroupSuggestedKeywordsResponseEx>> localVarResp = getAdGroupSuggestedKeywordsExWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, suggestBids, adStateFilter);
        return localVarResp.getData();
    }

    /**
     * Gets suggested keywords with extended data for the specified ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param suggestBids Set to &#x60;yes&#x60; to include a suggest bid for the suggested keyword in the response. Otherwise, set to &#x60;no&#x60;. (optional, default to no)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @return ApiResponse&lt;List&lt;AdGroupSuggestedKeywordsResponseEx&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<AdGroupSuggestedKeywordsResponseEx>> getAdGroupSuggestedKeywordsExWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String suggestBids, String adStateFilter) throws ApiException {
        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, suggestBids, adStateFilter, null);
        Type localVarReturnType = new TypeToken<List<AdGroupSuggestedKeywordsResponseEx>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets suggested keywords with extended data for the specified ad group. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of a valid ad group. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param suggestBids Set to &#x60;yes&#x60; to include a suggest bid for the suggested keyword in the response. Otherwise, set to &#x60;no&#x60;. (optional, default to no)
     * @param adStateFilter Filters results to ad groups with state matching the comma-delimited list. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupSuggestedKeywordsExAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, Integer maxNumSuggestions, String suggestBids, String adStateFilter, final ApiCallback<List<AdGroupSuggestedKeywordsResponseEx>> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAdGroupSuggestedKeywordsExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, maxNumSuggestions, suggestBids, adStateFilter, _callback);
        Type localVarReturnType = new TypeToken<List<AdGroupSuggestedKeywordsResponseEx>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAsinSuggestedKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param asinValue An ASIN. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAsinSuggestedKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String asinValue, Integer maxNumSuggestions, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/asins/{asinValue}/suggested/keywords"
            .replaceAll("\\{" + "asinValue" + "\\}", localVarApiClient.escapeString(asinValue.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (maxNumSuggestions != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxNumSuggestions", maxNumSuggestions));
        }

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAsinSuggestedKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String asinValue, Integer maxNumSuggestions, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getAsinSuggestedKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getAsinSuggestedKeywords(Async)");
        }
        
        // verify the required parameter 'asinValue' is set
        if (asinValue == null) {
            throw new ApiException("Missing the required parameter 'asinValue' when calling getAsinSuggestedKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = getAsinSuggestedKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, asinValue, maxNumSuggestions, _callback);
        return localVarCall;

    }

    /**
     * Gets suggested keywords for the specified ASIN.
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param asinValue An ASIN. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @return GetAsinSuggestedKeywordsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public GetAsinSuggestedKeywordsResponse getAsinSuggestedKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String asinValue, Integer maxNumSuggestions) throws ApiException {
        ApiResponse<GetAsinSuggestedKeywordsResponse> localVarResp = getAsinSuggestedKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, asinValue, maxNumSuggestions);
        return localVarResp.getData();
    }

    /**
     * Gets suggested keywords for the specified ASIN.
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param asinValue An ASIN. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @return ApiResponse&lt;GetAsinSuggestedKeywordsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetAsinSuggestedKeywordsResponse> getAsinSuggestedKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String asinValue, Integer maxNumSuggestions) throws ApiException {
        okhttp3.Call localVarCall = getAsinSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, asinValue, maxNumSuggestions, null);
        Type localVarReturnType = new TypeToken<GetAsinSuggestedKeywordsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets suggested keywords for the specified ASIN. (asynchronously)
     * Suggested keywords are returned in an array ordered by descending effectiveness.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param asinValue An ASIN. (required)
     * @param maxNumSuggestions The maxiumum number of suggested keywords for the response. (optional, default to 100)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> One or more query parameters contained an invalid value. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAsinSuggestedKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String asinValue, Integer maxNumSuggestions, final ApiCallback<GetAsinSuggestedKeywordsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAsinSuggestedKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, asinValue, maxNumSuggestions, _callback);
        Type localVarReturnType = new TypeToken<GetAsinSuggestedKeywordsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
